package xyz.zyl2020.java8.function;

import java.util.function.Consumer;

/**
 * @author ZhuYinglong
 * @date 2020/10/11 0011
 */
public class ConsumerDemo {

    public static void main(String[] args) {
        consumerDemo1();
        consumerDemo2(1024, integer -> System.out.println("consumerDemo2 --> " + integer));
    }


    static void consumerDemo1() {
        Consumer<Integer> consumer = integer -> System.out.println("consumerDemo1 --> " + integer);
        consumer.accept(1024);
    }

    static void consumerDemo2(Integer integer, Consumer<Integer> consumer) {
        consumer.accept(integer);
    }
}
